/**
 * Created by ospip on 2017/10/10.
 * Copyright (c) 2017 LLAP. All rights reserved.
 */
public class Pixel extends Point {
    protected Color color;

    public Pixel(int x, int y, int color) {
        super(x, y);
        this.color = new Color(color);
    }

    public Pixel(int x, int y, int r, int g, int b) {
        this(x, y, Color.RGB(r, g, b));
    }

    public Pixel(int x, int y) {
        this(x, y, Color.BLACK);
    }

    public Pixel(int color) {
        this(0, 0, color);
    }

    public Pixel() {
        this(0, 0, Color.BLACK);
    }

    @Override
    public String toString() {
        return String.format("<Pixel 0x%S, Position (%d, %d), Color RGB(%d, %d, %d)>",
                Integer.toHexString(this.hashCode()), super.getX(), super.getY(),
                color.getRED(), color.getGREEN(), color.getBLUE());
    }

    public static void main(String[] args) {
        Pixel p = new Pixel(178, 439, Color.CYAN);
        System.out.println(p);
    }
}
